import { createRouter, createWebHistory } from 'vue-router'


const routes = [
  
  {
    path: '/',
    name: 'login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/home',
    name: 'home',
    redirect:'user',
    component: () => import( '../views/Home.vue'),
    children:[
      {
        path:'/user',
        component:()=> import('@/views/User.vue')
      },
      {
        path:'/order',
        component:()=> import('@/views/Order.vue')
      },
      {
        path:'/items',
        component:()=> import('@/views/Items.vue')
      }
    ]
  },
  {
    path:'/shop/:id',
    component:()=> import("../views/Shop.vue")
  },
  {
    path:'/userlogin',
    component:()=> import("../views/UserLogin.vue")
  },
  {
    path:'/userorder/:id',
    component:()=> import("../views/UserOrder.vue")
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
